class CLanguage:

    def __init__(self, name):
        self.name = name

    def setName(self, name):
        self.name = name

    def getName(self):
        return self.name


clang = CLanguage("C语言中文网")

print(clang.name)
print(clang.getName())

clang.setName("Python教程")
print(clang.getName())


# property
class CLanguage2:

    def __init__(self, name):
        self.__name = name

    def setName(self, name):
        self.__name = name

    def getName(self):
        return self.__name

    def delName(self):
        self.__name = "xxx"

    name = property(getName, setName, delName, '属性')


help(CLanguage2.name)

clang2 = CLanguage("C语言中文网")
print(clang2.name)
print(clang2)

clang2.name = "python"
print(clang2.name)

del clang2.name
print(clang2.name)
